perm filename 3[00,BGB]1 blob sn#041494 filedate 1973-05-16 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00008 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	USING CRE.
C00005 00003	LESSON 2  -  IMAGE INPUT, OUTPUT AND XGP'ing.
C00008 00004	CRE TELETYPE COMMANDS
C00011 00005	NODE FOLLOWING COMMANDS______________________________________________
C00015 00006	CART DRIVING COMMANDS________________________________________________
C00020 00007	SAIL INTERFACING TO CRE.
C00023 00008	LISP INTERFACING TO CRE.
C00027 ENDMK
C⊗;
USING CRE.

	A. PRIMER ON RUNNING CRE.
	B. TELETYPE COMMANDS.
	C. SAIL INTERFACING.
	D. LISP INTERFACING.


PRIMER ON RUNNING CRE.


LESSON 1  -  Single Image Contouring.

	The Stanford  copy of  CRE is  run by  typing "R  CRE".   CRE
displays  only  on a  III console,    however it  will  work (without
displays) when run  from a Data Disc  console. CRE's command  scanner
is a  simple character jump table;  the command scanner will  type an
asterisk  when it is  listening for teletype  input. Carriage Returns
following  commands  are  unnecessary  but  harmless;  most  commands
signal  their  completion by  displaying  something  or  by typing  a
carriage return. Some commands require  arguments or filenames.   The
?  command will display a summary of all the other commands.

	Command character  may me  modified by  the control and  meta
shift  keys;  such keying  will  be indicated  by  the  prefixing the
characters as  α,  β,  and  ε  to indicate  control,  meta  and  both
meta-control respectively.

	The command "T" will take a four  bit television picture from
camera  number one. The command  "H" will display a  histogram of the
television picture.  The  command character  SPACE will  refresh  the
image you had before the  histogram display. The command "C" followed
by a  list of octal numbers followed by a carriage return will make a
contour image and display it. Thus the teletype discourse should have
the following appearance:

↑C

.R CRE

*T
*H 
*C20 40 60
*

And this should result in a single contoured image being displayed.
LESSON 2  -  IMAGE INPUT, OUTPUT AND XGP'ing.

	After you have  an image and  its contours; you can  save one
or the  other or both on  disk files; or print one  or the other. The
"O" command will output a video  image file, in the new hand-eye  200
octal word header format. The "I"  will input a video image from such
a  hand-eye file; if the file  is not 216 by  288, then the center of
the image will be placed  coincidant with the center of a 216  by 288
window and  the image will be  repacked with undefined  pixels set to
zero. Both the "I" and the "O"  commands will ask for a filename;  if
an extension  is  not explicitly  given the  default extension  "TMP"
will  be used. The  "αO" command will  output the  CRE data structure
and the  "αI" command  will input  CRE data  structure, naturely  the
default extension is "CRE".

	The "X"  command will output  a video image  to the  XGP. The
"εC"  command followed  by a  list of octal  numbers will  output the
HSEG and VSEG;  raw vector  contours, to  the XGP.   The "P"  command
will  output  the  currently  displayed III  buffer,    naturely  the
default  extension is "III".  Finally, the "J"  contrast enhances the
contrast of an image for the sake of its appearance on the XGP.

LESSON 3  -  INTERACTIVE (MANUAL) MULTI IMAGE PROCESSING.
LESSON 4  -  APPRECIATING THE DATA STRUCTURE.
LESSON 5  -  AUTOMATIC MULTI IMAGE PROCESSING.
CRE TELETYPE COMMANDS

VIDEO COMMANDS_______________________________________________________

  T	 Take a 4-bit television picture.
 αT	 Take a 6-bit television picture.
  S	 Select camera number, default is camera #1.
 αS	 Set TCLIP, default is 0.
 βS	 Set BCLIP, default is 7.
 εS	 Shrink node space. Calls node storage compactor.

	The two  command characters  "T" and  "S" control live  video
camera input.  The default camera is camera #1  on the Cohu camera on
the hand eye table. Camera #0 is the Cart Receiver, camera #2  is the
sierra hand eye camera,  and camera #3 is one or  the other old brown
cameras depending  on which coax is plugged up, the brown camera near
III23 is the Font Camera  and the brown camera near the  turntable is
the GEOMED Camera.

INPUT OUTPUT COMMANDS________________________________________________

  I      Input TMP file.	Television image from disk file.
 αI      Input CRE file.	Contour film from disk file.

  O      Output TMP file.	Television image to disk file.
 αO      Output CRE file.	Contour film to disk file.

  X      Output video image to XGP.
  P      Output III file.	III buffer for calcomp plotter.
 εC   	 Output VIC contour edges to XGP.
	 This command requires a list of octal numbers.
  J   	 Contrast enhancement for the sake of XGP appearance.
  #	 Type twenty CRLF's to clear page printer.
  ?	 Display help summary of CRE commands.

IMAGE CONTOURING COMMANDS____________________________________________

   C   Cut at given threshold levels.
   Q   Cut at equally spaced conttours, three cuts: 20, 40, 60.
  αQ   Seven cuts: 10, 20, 30, 40, 50, 60, 70.

   E	Enable all CRE processing.
   D	Disable all steps except contouring.

   M	 Compare and mate match current image with previous.
   W	 Enter Arc Width Table alter mode.
NODE FOLLOWING COMMANDS______________________________________________

 +       Fetch film node.
 !       Flush node display.

 , .     CW,,CCW         ...fetch Ring links.
 < >     DAD,,SON        ...fetch Tree links.
         TYPE,,RELLOC
 ∪ ∩     ENDO,,EXO       ...fetch nested polygon tree links.
 ≤ ≥     ALT,,NCNT       ...fetch alternate shape or arc link.
 ⊂ ⊃     NGON,,PGON      ...fetch nested polygon tree links.
 ∨ ∧     NTIME,,PTIME    ...fetch time line links.

	These 14 commands  allow detailed inspection of the  CRE data
structure  by showing the  contents of a  node.  Data  halfwords of a
node are displayed  in octal; link  halfwords are displayed  prefixed
with a  letter indicating the type  of node being pointed  at; a zero
link is displayed as "NIL".

	The  FILM  node,    which  is  the  root  of  the whole  data
structure is  fetched and  displayed by the  "+" command.   From  the
Film, the  ">" command can be  used to get SON(FILM)  which is always
the first image, and  ">" command of  an image will  get a level  and
">"  of  a  level  will get  a  polygon.  Vectors  and  polygons  are
intensified  when  their  contents are  being  displayed.   The  exit
command is "!", which leaves the screen less cluttered.

WINDOW SCROLLING COMMANDS_____________________________________________

  ;      Move camera left.
  :      Move camera right.
  (      Move camera down.
  )      Move camera up.

  -      Zoom out, shrink displayed image.
  *      Zoom in,  expand displayed image.
 αZ      Reset scrolling window to it initial position and size.
  /      Halve strength of scrolling delta.
  \      Double strength of scrolling delta.

  ↔	 Single step displayed image forwards.
 α↔	 Single step displayed image backwards.
 β↔	 Run film display forwards.
 ε↔	 Run film display backwards.

	The first several commands allow minute examination of the image
by magnification and window positioning. The command character "↔" allows
single stepping thru the film of images or continous display of the
film forwards or backwards.
CART DRIVING COMMANDS________________________________________________

  F      Drive forwards.
  B      Drive backwards.
  L      Turn wheels hard left.
  R      Turn wheels hard right.
  αL     Pan camera left.
  αR     Pan camera right.
  SPACE  Stop the cart.
  RETURN Exit cart command mode.

	First, and  most important is  understanding how to  stop the
cart.   The teletype halt command is  SPACE; also any character other
than "F", "B",  "L",  or "R" will stop  the cart.  Cart commands  are
passed first from  a teletype to the PDP-10; then  to the PDP-6; then
over  a citizens  band,  27.045  megahertz,   radio link  to the cart
control logic. When communication is lacking between  entities in the
chain of  command the lower entity  times out and causes  the cart to
halt. The cart control logic times out  in a fifth of a second if  it
does not  hear from the  PDP-6; the  PDP-6 times out  in less than  a
minute  if  it  has  not  heard  from  the  PDP-10; the  PDP-6  stops
broadcasting cart commands  if it  detects the death  of the  PDP-10;
the PDP-10  job times  out after  5 minutes of  not hearing  from the
teletype and kills the PDP-6 spacewar job.

	Second,   and of occasional interest  is understanding how to
make the cart go.   The command "F"  will make the cart  go forwards;
and the other  commands will cause action as  mentioned in the table.
If the cart fails to move; all its switchs should be check for  being
in the  ON or  AUTOMATIC or FAST  position; all  its plugs should  be
plugged  in; and  its  batteries should  be checked.    Recently cart
failure had been most  often caused by  the radio transmitter in  the
Kludge Bay.  Check to see that  the transmitter is turned on and that
the  PDP-6 is running.  Hitting and  shaking the transmitter; as well
as disconnecting  and reconnecting  its power; will  usually make  it
work.

CART HARDWARE DIAGONOSTIC____________________________________________

  V          Enter diagonostic listen loop.
  RETURN     Exit diagonostic listen loop.

  NUMERALS:   0,1,2,3,4,5,6,7  send direction relay bits.
  CHARACTERS: H,A,B,C,D,E,F,G  send action relay bits.

	The cart diagonostic  listen loop simply takes the  low order
four  bits of  a non-carriage return  ASCII character  and broadcasts
them to the cart. The cart decodes four bit radio command  bytes into
six  relays; commands  0  thru  7 set  the  pan,  drive, or  steering
direction  relay repective to bits 4, 2 and  1; commands A thru G set
the pan, drive,  or steering action relays  respective to bits 4,  2,
and 1.
SAIL INTERFACING TO CRE.

	It should be possible to embed the CRE machine code  under  a
SAIL  core  image;  however  I do not intend to do this work. For the
present, the CRE interface to SAIL is only realized via a  disk  file
transfer  of  the  data  structure.   A  CRE file may be read into an
integer array in binary mode as illustrated below.

	The  first  word  of a CRE file is the first word of the film
node which contains the size of the file in words. The film node  has
address  0;  the  next node has address 7; and so on in multiplies of
seven.  There are no empty nodes in a CRE file.  The  following  SAIL
program will read in a CRE file named X:

	COMMENT EXAMPLE OF SAIL INPUT OF A CRE FILE;
	BEGIN	"TEST"
		INTEGER SIZE;
		OPEN(1,"DSK",8,3,0,0,0,0);
		LOOKUP(1,"X.CRE",0);
		SIZE ← WORDIN(1);
	BEGIN
		INTEGER ARRAY NODE[0:SIZE];
		ARRYIN(1,NODE[1],SIZE-1);
		RELEASE(1);
		"MAIN PROGRAM.";
	END;
	END;

After the NODE array is loaded, CRE links and data may be accessed by
their  document names in a reasonible node-link notation using macros
like the following:

	DEFINE CW(Q)  = "(NODE[Q] LSH -18)";
	DEFINE CCW(Q) = "(NODE[Q] LAND '777777)";
	DEFINE DAD(Q) = "(NODE[Q+1] LSH -18)";
	DEFINE SON(Q) = "(NODE[Q+1] LAND '777777)";

So  that  the first vertex of the first polygon of the first level of
the first image of the film can be obtained:

	INTEGER FILM,IMAGE,LEVEL,POLYGON,VERTEX;

	FILM ← NODE[0];
	LEVEL ← SON(FILM);
	POLYGON ← SON(LEVEL);
	VERTEX ← SON(POLYGON);

The  user may note that SAIL will compile three or more instructuions
for what is known as a PDP-10 halfword operation; also  if  the  user
converts  the  CRE  nodes  and links into LEAP items and associations
then an  overhead  of  from  ten  to  one  hundred  instructions  per
"halfword operation" will be incurred.
LISP INTERFACING TO CRE.

	It should be possible  to embed the CRE machine  code under a
LISP  core image; however I  do not intend  to do this  work. For the
present, the CRE interface to LISP  is only realized via a disk  file
transfer of  the data structure.   A CRE file  may be read  into LISP
binary  program space  and accessed  using the CRE  nomensclature (11
link  names  and  13  datum  names)  by  means  of  the  S-Expression
subroutines provided  in the file CRE.LSP[CRE,BGB].   The subroutines
work in both the old Stanford LISP 1.6 as well as the newer UCI  LISP
and Micro Planner, PLNR.  The CRE.LSP[CRE,BGB] can be load  by either
one or the other of the following tWo LISP statements:

	(DSKIN(CRE,BGB)(CRE.LSP))
	(INC(INPUT(CRE,BGB)(CRE.LSP)))

A CRE film file is read into LISP binary program space by one of the
three possible INCRE formats:

	(INCRE filename)
	(INCRE filename project)
	(INCRE filename project programmer)

Filenames should be  six characters or less, projects  and programmer
initials should  be three characters or  less, the filename extension
CRE is  assummed and the  usual PPPN  defaults  occur. If  the  input
succeeds INCRE returns a value T;  if the input fails INCRE returns a
value NIL and prints one or the other of these two messages:

	CRE FILE NOT FOUND
	CRE FILE BIGGER THAN BINARY PROGRAM SPACE

After a  sucessful INCRE; the  film, image,  level, polygon, arc  and
vector  are  referred   to  by  integers  using  the  11  Link  Fetch
Subroutines:
	(CW node)(CCW node)(DAD node)(SON node)(ENDO node)(EXO node)
	(ALT node)(NGON node)(PGON node)(NTIME node)(PTIME node)

The film  node's  address is  the  integer 0,   zero.    So that  the
expression  (SETQ V3(CCW(CCW(SON(SON(SON(SON  0)))))))  will retrieve
the lower right hand corner of the border polygon of the -1  level of
the first image  of the film. The 13 CRE.LSP  datum fetch subroutines
are:
	(ROW node)(COL node)(CRETYPE node)(RELOC node)
	(CNTRST node)(NCNT node)(ZDEPTH node)(PERM node)(AREA node)
	(MXX node)(MYY node)(MZZ node)(PXY node)